package com.farmer.utils;

/**
 * 统一返回结果状态信息类
 *
 */
public enum ResultCodeEnum {

    SUCCESS(200,"success"),
    FAULT(222,"fault"),
    USERNAME_ERROR(501,"用户名错误"),
    PASSWORD_ERROR(503,"密码错误"),
    NOTLOGIN(504,"没有登录"),
    NOT_SUFFICIENT_FUNDS(600,"余额不足，请充值后购买"),
    USERNAME_USED(505,"用户名已存在"),
    ADMIN_NOTEXSIST(506,"管理员不存在"),
    USER_NOTEXSIST(507,"用户不存在"),
    NO_PERMISSION(700,"没有这个权限"),
    ADMIN_NOT_HAVE_ROLE(701,"管理员不是这个角色"),
    USER_NOT_HAVE_ROLE(702,"用户不是这个角色");

    private Integer code;
    private String message;
    private ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
    public Integer getCode() {
        return code;
    }
    public String getMessage() {
        return message;
    }
}
